package com.publishproject.test.aidl;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author Android客户端组-tanghongbin
 * @Title: Article
 * @Package com.publishproject.test.aidl
 * Copyright: Copyright (c) 2016
 * Company: 成都壹柒互动科技有限公司
 * @date 2017/1/10 15:41
 * @Description: TODO
 */
public class Article implements Parcelable {
    private String title;
    private String content;

    public Article() {
    }

    protected Article(Parcel in) {
        title = in.readString();
        content = in.readString();
    }

    public static final Creator<Article> CREATOR = new Creator<Article>() {
        @Override
        public Article createFromParcel(Parcel in) {
            return new Article(in);
        }

        @Override
        public Article[] newArray(int size) {
            return new Article[size];
        }
    };

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(title);
        dest.writeString(content);
    }

    public void readFromParcel(Parcel dest){
        title = dest.readString();
        content = dest.readString();
    }
}
